package com.qyl.honghengshop.dao.impl;

import org.apache.ibatis.session.SqlSession;

import com.qyl.honghengshop.dao.AddressDao;
import com.qyl.honghengshop.dao.BaseDao;
import com.qyl.honghengshop.dto.Address;
import com.qyl.honghengshop.mapper.AddressMapper;
import com.qyl.honghengshop.mapper.GoodsMapper;

public class AddressDaoImpl extends BaseDao implements AddressDao {

	@Override
	public Address getDefaultAddress() {
	
		//获得sqlSession
		SqlSession sqlSession = this.getSqlSession();
		
		AddressMapper addressMapper = sqlSession.getMapper(AddressMapper.class);

		Address address = addressMapper.getDefaultAddress();
		
		//关闭sqlSession
		this.closeSqlSession();

		return address;
	}

}
